How to parse a string to get array of